package com.cqs.example.io.serial.bo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.assertj.core.util.Lists;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class MessageBean implements Serializable {
    private static final long serialVersionUID = -4926059510399561524L;
    private String msg;
    private List<String> list;
    private Map<String, String> map;
    private byte[] bytes;


    public static MessageBean mockBean() {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < 10; i++) {
            map.put(String.valueOf(i), "消息的长度是......" + i);
//            map.put(String.valueOf(i),"消息的长度是......");
//            map.put(String.valueOf(i),String.valueOf(i));
        }
        return MessageBean.builder()
                .msg("messageBean")
                .list(Lists.newArrayList(String.valueOf(System.currentTimeMillis())))
                .bytes("byte数组".getBytes())
                .map(map)
                .build();
    }
}
